package com.wise.site.model;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.Projection;

public class MyPostionOverlay extends Overlay {
	private Bitmap mBitmap;
	private GeoPoint mPoint;
	
	
	public MyPostionOverlay(Bitmap bitmap, GeoPoint point) {
		mBitmap = bitmap;
		mPoint = point;
	}
	
	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		// TODO Auto-generated method stub
		//super.draw(canvas, mapView, shadow);
		if(! shadow){
			Projection projection = mapView.getProjection();
			Point point = new Point();
			projection.toPixels(mPoint, point);
			canvas.drawBitmap(mBitmap, point.x - mBitmap.getWidth()/2, point.y - mBitmap.getHeight(), null);
		}
		
	}

}
